moduleAplicacao.controller("historia", function($scope, $window, historiaService) {

    var ng = $scope.ctrl_historia = {};
    $scope.headerTitle = $scope.getProperty('aconteceu.comigo');

    ng.historia = {};
    ng.historias = [];
    
    ng.init = function(){
    	console.log('>>> HISTORIAS <<<')
    	ng.getHistorias();
    };
    
    ng.getHistorias = function() {
    	historiaService.getHistorias(function(data) {
    		ng.historias = data;
        });
    };
    
    ng.save = function() {
    	historiaService.save(ng.historia, function(data) {
    		alert(data);
        });
    };
    
    ng.init();
});

